import request from '@/config/axios'

// 地址管理 VO
export interface AddressVO {
  id: number // id
  address: string // 样本领取地址
  contactName: string // 实验室联系人
  contactPhone: string // 联系电话
}

// 地址管理 API
export const AddressApi = {
  // 查询地址管理分页
  getAddressPage: async (params: any) => {
    return await request.get({ url: `/jikong/address/page`, params })
  },

  // 查询地址管理详情
  getAddress: async (id: number) => {
    return await request.get({ url: `/jikong/address/get?id=` + id })
  },

  // 新增地址管理
  createAddress: async (data: AddressVO) => {
    return await request.post({ url: `/jikong/address/create`, data })
  },

  // 修改地址管理
  updateAddress: async (data: AddressVO) => {
    return await request.put({ url: `/jikong/address/update`, data })
  },

  // 删除地址管理
  deleteAddress: async (id: number) => {
    return await request.delete({ url: `/jikong/address/delete?id=` + id })
  },

  // 导出地址管理 Excel
  exportAddress: async (params) => {
    return await request.download({ url: `/jikong/address/export-excel`, params })
  }
}